TeX is a widely used text formatting program developed by Donald Knuth. Donald E. Knuth, The TeXBook, Addison-Wesley, Reading, Mass. 1984. TeX uses a concept known as xe2x80x9cgluexe2x80x9d to express dimensional preferences of fill objects and incorporates different stretch and compression orders that can be used to describe the stretchiness and compressibility of different kinds of fill objects. As the overall dimensions of a layout change, the dimensions of individual fill objects change dependent on preferred sizes and stretchiness of those objects.
A graphics tool kit developed by Robert Halstead called Stk incorporates the concept of an elastic, known as xe2x80x9cglue,xe2x80x9d having a minimum size, a stretchiness coefficient and a stretch order associated with graphical objects having content. The tool kit formalizes the layout computations of horizontal and vertical boxes of graphical objects in terms of elastic add, max and divide operations. Stk is not widely known or used. The layout mechanism of Stk was incorporated into Swat, a graphics toolkit developed at MIT by Harold Abelson, James Miller and Natalya Cohen.
In accordance with the present invention, a system, method and data structure are provided to facilitate the layout of graphical objects. Distinct stretch and compression properties are defined for unit graphical objects with content. Those properties are processed to define individual layouts of the graphical objects within an overall graphical layout. The preferred data structure defining elastics comprises a size value, a stretch property, and a compression property independent of the stretch property. Processing is facilitated by associating the elastics directly with unit, i.e., leaf, graphical objects having content as opposed to being associated merely with fill objects which surround the content objects.
Preferably, the stretch properties comprise stretchiness coefficients to be applied to sizes designated for the graphical objects, and the compression properties comprise compressibility coefficients to be applied to the sizes designated for the graphical objects. The stretch and compression properties may comprise stretch and compression orders to indicate substantial relative differences between stretchiness and compressibility relative to those properties of other graphical objects. Stretch and compression properties of the graphical objects may also be defined through compact representations which share like stretch and compression properties.
Preferably, the data structures defining elastics of the graphical objects define minimum and preferred sizes of the graphical objects, and those minimum and preferred sizes are processed to define the individual layouts.
Various operations can be applied to the graphical objects. In an add operation, the stretchiness and compressibility coefficients of plural graphical objects are summed dependent on the relative stretch and compression orders. Specifically, the stretchiness and compressibility coefficients, respectively, are summed if the respective stretch and compression orders are equal, and if the respective stretch and compression orders are not equal, an add result includes the stretchiness and compressibility coefficients of the graphical object indicated to be most elastic by the stretch and compression orders. The stretch and compress orders, respectively, having the greatest elasticity may be taken as the order of properties of the add result.
In a max operation, a size is selected from two graphical objects dependent on the relative compressibility and stretchability of the graphical objects. A max result is the size of the graphical object whose elasticity toward the other size is the least. The stretch and compression properties of the max result are selected from the graphical object from which size was selected or, if the size of the two graphical objects is the same, from the graphical object which was least elastic.